package com.fm.service;

/**
 * Created by Administrator on 2018/7/30 0030.
 */

import com.fm.entity.TopicLog;
import com.fm.mapper.TopicLogMapper;
import org.springframework.data.domain.Example;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Optional;

@Service
public class TopicLogService extends MBaseService<TopicLog, Integer, TopicLogMapper>{

    public TopicLog selectOneByEquipment(Integer eqId) {
        TopicLog example = new TopicLog();
        example.setEquipmentId(eqId);
        List<TopicLog> log = getMyBatisDao().findAll(Example.of(example));
        if (log != null && log.size()>0)
            return log.get(log.size()-1);
        else
            return null;
    }
}
